import { Component } from '@angular/core';
import { RgvConfig } from 'src/components/scenarios/models';
import { RgvNode } from 'src/components/scenarios/nodes/RgvNode';
import { InfoSidebar } from '../../InfoSidebar';

@Component({
  selector: 'app-rgv-info',
  templateUrl: './rgv-info.component.html',
  styleUrl: './rgv-info.component.scss'
})
export class RgvInfoComponent implements InfoSidebar {
  cfg?: RgvConfig;
  item?: RgvNode;
  sidebarVisible: boolean = false;
  get status() {
    return this.item?.data.Values?.Status;
  }

  onShow(cfg: RgvConfig, item: RgvNode) {
    this.cfg = cfg;
    this.item = item;
    this.sidebarVisible = true;
  }
  onSidebarHide(): void {
    this.sidebarVisible = false;
    this.cfg = undefined;
    this.item = undefined;
  }

}
